package com.dyson.controller;

import com.dyson.config.MyWebSocket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author:DysonWy@Gmail.com
 * @time:2019/8/13 16:48
 */
@Controller
public class IndexAct {
    @Autowired
    private MyWebSocket socket;

    @RequestMapping("/")
    public String index() {
        return "index";
    }

    @RequestMapping("/sendResult")
    @ResponseBody
    public String index(@RequestParam String sessionId) {
        socket.sendResult(sessionId);
        return "ok";
    }
}
